﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Collections.Generic.IEnumerable<GabageFactory.Models.Stack>>" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	堆场列表
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <% using (Html.BeginForm("Index", "Stack", FormMethod.Get))
    {%>

    <div class="search_bar">
        <span class="left_s"></span>
        <label>所属公司：</label>
        <%= Html.DropDownList("factoryId", ViewData["factories"] as List<SelectListItem>, "请选择公司")%>
        <label>堆场名称：</label>
        <input type="text" name="name" value="" size="15" maxlength="50"/>
		<input type="submit" value="搜 索" />
    </div>

    <%} %>

    <p class="sys_create_btn">
        <%= Html.ActionLink("创建堆场", "Create") %>
    </p>

    <table class="style_table2" cellpadding="4" cellspacing="0" border="0" style="margin-top:20px">
       <tr>
    	    <th style="width:60px; text-align:center;">编号</th>
    	    <th style="text-align:center;">公司名称</th>
            <th style="width:240px; text-align:center;">堆场名称</th>
    	    <th style="width:160px; text-align:center;">创建时间</th>
		    <th style="width:160px; text-align:center;">修改时间</th>
		    <th style="width:100px; text-align:center;">操作</th>
	    </tr>
        <% foreach (var item in Model) { %>
	    <tr onmouseover="this.className='trbgmouseover'"  onmouseout="this.className='trmouseout' ">
	        <td style="text-align:center;"><%= item.Id %></td>
            <td> <%= item.Factory.Name %></td>
		    <td> <%= item.Name %></td>
		    <td style="text-align:center;"> <%= item.CreateTime %></td>
            <td style="text-align:center;"> <%= item.ModifyTime %></td>
		    <td style="text-align:center;">
                <%= Html.ActionLink("编辑", "Edit", new { id=item.Id }) %> | 
                <%= Html.ActionLink("删除", "Delete", new { id = item.Id }, new { onclick=@"return confirm('确定删除堆场" + item.Name + @"吗？');"})%>
            </td>
        </tr>
        <%} %>
    </table>
</asp:Content>